package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.sql.Date;
import java.util.Objects;

@Entity
public class Timeline {
    private int timelineId;
    private Integer customerId;//客户
    private String timelineTitle;
    private String timelineContent;
    private Date timelineCreatetime;
    private String timelintRouter;//路由
    private Integer timelineEmp;//员工
    private Integer tainId;//维修主表
    private Integer sort;//排序

    @Id
    @Column(name = "timeline_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getTimelineId() {
        return timelineId;
    }

    public void setTimelineId(int timelineId) {
        this.timelineId = timelineId;
    }

    @Basic
    @Column(name = "customer_id", nullable = true)
    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    @Basic
    @Column(name = "timeline_title", nullable = true, length = 255)
    public String getTimelineTitle() {
        return timelineTitle;
    }

    public void setTimelineTitle(String timelineTitle) {
        this.timelineTitle = timelineTitle;
    }

    @Basic
    @Column(name = "timeline_content", nullable = true, length = 255)
    public String getTimelineContent() {
        return timelineContent;
    }

    public void setTimelineContent(String timelineContent) {
        this.timelineContent = timelineContent;
    }

    @Basic
    @Column(name = "timeline_createtime", nullable = true)
    public Date getTimelineCreatetime() {
        return timelineCreatetime;
    }

    public void setTimelineCreatetime(Date timelineCreatetime) {
        this.timelineCreatetime = timelineCreatetime;
    }

    @Basic
    @Column(name = "timelint_router", nullable = true, length = 255)
    public String getTimelintRouter() {
        return timelintRouter;
    }

    public void setTimelintRouter(String timelintRouter) {
        this.timelintRouter = timelintRouter;
    }

    @Basic
    @Column(name = "timeline_emp", nullable = true)
    public Integer getTimelineEmp() {
        return timelineEmp;
    }

    public void setTimelineEmp(Integer timelineEmp) {
        this.timelineEmp = timelineEmp;
    }

    @Basic
    @Column(name = "tain_id", nullable = true)
    public Integer getTainId() {
        return tainId;
    }

    public void setTainId(Integer tainId) {
        this.tainId = tainId;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Timeline timeline = (Timeline) o;
        return timelineId == timeline.timelineId &&
                Objects.equals(customerId, timeline.customerId) &&
                Objects.equals(timelineTitle, timeline.timelineTitle) &&
                Objects.equals(timelineContent, timeline.timelineContent) &&
                Objects.equals(timelineCreatetime, timeline.timelineCreatetime) &&
                Objects.equals(timelintRouter, timeline.timelintRouter) &&
                Objects.equals(timelineEmp, timeline.timelineEmp) &&
                Objects.equals(tainId, timeline.tainId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(timelineId, customerId, timelineTitle, timelineContent, timelineCreatetime, timelintRouter, timelineEmp, tainId);
    }
}
